<?php
namespace Admin\Controller;
use Think\Controller;

class VueController extends BaseController {
    public function list_(){
    	#+----------------------------------
        # * 查询
        #+----------------------------------
        // $uid = $_COOKIE['wen_admin_userid'];

        $info = M()->query("SELECT * FROM  web_info");

        $this -> assign( "info", $info); 
     
        #+----------------------------------
        # * 显示页面
        #+----------------------------------
    	$this->display();
    }
    public function edit(){

        // print_r($_GET);exit;
        foreach ($_GET as $k => $v) {
        	$re = M('web_info')->where("name= '$k'")->save(array('value'=>"$v"));
        }
        if($_GET){
            echojson('修改成功',1);
        }else{
            echojson('修改失败',0);
        }
        
        //处理img地址
        /*$arr = $_GET;
        $search = array(__ROOT__,'/public/images/');
        $arr['avater'] = str_replace($search,'',$_GET['avater']);
        $re = M('adminuser')->where("id=$id")->save($arr);
        // echo M()->getLastSql();exit;
        if($re){
            echojson('修改成功',1);
        }else{
            echojson('修改失败',0);
        }*/

    }

}